package triangle;

import java.awt.*;

	public class Triangle extends Component {

		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		Point a;
		Point b;
		Point c;
		Rectangle r;
		int height;
		int length;
		Polygon p;
		Color colour;
	
	
	
		
		
	public Triangle (Point a, Point b, Point c, Color colour) {
			// 
			this.a = a;
			this.b = b;
			this.c = c;
			int[] xpoints = {a.x, b.x, c.x};
			int[] ypoints = {a.y, b.y, c.y};
			p = new Polygon (xpoints, ypoints, 3);
			this.colour = colour;
	}
		
		public void paint (Graphics g) {
		
			System.out.println("hallo");
		// line from a to c

		
		if (this.colour != null )
		{	
		g.setColor(colour);
		g.fillPolygon(p);
		}
		else
		{
			g.drawPolygon(p);
		}
		
		
	}
	
	
}
